In an operating system parlance, the kernel is the set of modules forming the core of the operating system. The kernel is loaded into main memory first on startup of a computer and remains in main memory providing services such as memory management, process and task management, and disk management. The kernel also handles such issues as startup and initialization of the computer system.
Before a computing device such as a desktop computer, laptop, server workstation, etc., may accomplish a desired task, it receives an appropriate set of executable instructions. Executed by a processor, these executable instructions can be used to direct the operation of the device. These instructions can be stored in a memory of the computing device.
In some systems, virtual memory is used to locate data in physical memory. Virtual memory is a technique within the memory management subsystem to allow the processor to access a larger memory address space than the physical memory space that actually exists in the processor system of a computing device. In particular, the operating system can implement a virtual memory system to map a virtual address associated with a process from a large virtual address space to a physical address of a physical memory, which is typically random access memory (RAM).
The translation can be transparent to the program. The memory management system of the operating system tracks both assigning and releasing memory in connection with the multiple processes and threads. A computer system is not limited to a single virtual address space. Indeed, it may implement as many virtual address spaces as its operating system is capable of supporting. For example, modern operating systems often support multiple processors and multiple threads of execution, thereby allowing the sharing of the system resources and further providing multiple concurrent processes and threads that execute simultaneously. The virtual address spaces are usually separate from each other to prevent overlapping processes and/or data.
To aid the mapping process, the virtual address memory space can be divided into chunks of memory space called pages which correspond to chunks of physical address memory space called frames, or physical pages. Some systems use pages that are uniform in size, however, some systems can support multiple page sizes and, in such systems, organization of such pages has typically been handled as if the pages were uniform.
Operating systems can store maps of virtual to physical pages in data structures known as page tables. In systems using non-uniform page sizes, page sizes can range, for example, from below 4 KB to over 4 GB. Typically, page tables reference individual pages by using a separate data structure for each page in a page table. In such systems, larger pages can be represented as collections of smaller sized pages. For example, if a typical page size in a system is 4 KB, a larger 1 MB page may be broken into 4 KB segments when referenced in the page table. Using a separate data structure to reference each smaller page, within a larger page, results in inefficient memory use.
Typically, an operating system maintains a separate page table for each process (i.e., each running instance of a program). These page tables can exist in a main memory location (e.g., volatile memory such as RAM) and can occupy significant portions of this main memory.
Therefore, many operating systems have to provide the ability to page their page tables. This involves writing kernel memory and data structures (e.g., page tables), which describe application memory, to secondary memory (i.e., to non-volatile memory or to a storage device), when main memory is low. Paging the page table can result in implementation of complicated logic and it can slow the operation of application processes by utilizing additional access to secondary memory.
Furthermore, many systems that may use multilevel page tables do not match the order of the page table levels and the depth of the page tables to the various page sizes supported by the OS and/or hardware, but rather use arbitrary page sizes and/or do not provide a useful granularity that reduces processor and memory resource usage.